<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

</body>
<script>
// 普通数组
let asyncRoutesStr = ['employees','departments','settings']
//要求1-过滤出内容为'employees','settings'的数据
let menus = ['employees','settings']
// let filterRoutesStr = asyncRoutesStr.filter(t => t === 'employees' || t === 'settings')
let filterRoutesStr = asyncRoutesStr.filter(t => ['employees', 'settings'].includes(t))
console.log(filterRoutesStr)
// 对象数组
// let asyncRoutesObj = [{name: 'employees'}, {name: 'departments'}, {name: 'settings'}]
//要求2-过滤出name为'employees','settings的数据
// let filterRoutesObj = []

// 复杂的对象数组
// let asyncRoutes = [
//   {chidren:[{name: 'employees'}]},
//   {chidren:[{name: 'departments'}]},
//   {chidren:[{name: 'settings'}]}
// ]
//要求3-过滤出子元素name为'employees','settings的数据
// let filterRoutes = []
</script>
</html>
